package br.com.sgh.dao;

import java.util.List;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

public class FuncionarioDAO<T> extends DAO<T> {

    public FuncionarioDAO(Class<T> classe, Session session) {
        super(classe, session);
    }

    public List<T> funcionarios() {
        List<T> funcionarios = getEntitys();
        return funcionarios;
    }

    public List<T> verificaLogin(String login) {
        Criterion filtro = Restrictions.eq("matricula", login);
        Criteria criteria = criaCriteria();
        List<T> funcionarios = criteria.add(filtro).list();
        return funcionarios;
    }

}
